package jqgridjavawrapper;

/**
 * @author Isuru Madushanka Weerarathna
 * @contact uisurumadushanka89@gmail.com
 */
public class JQGridSubGrid implements JQPropertyMaker {

    private JQGridSubGridOptions subGridOptions = null;
    private JQGridSubGridModel subGridModel = null;
    private int subGridWidth = 20;
    private String subGridURL = null;
    private String subGridType = null;
    
    public StringBuilder generateProperties() {
        StringBuilder sb = new StringBuilder();

        if (subGridOptions != null) {
            sb.append(subGridOptions.generateProperties());
        }
        if (subGridModel!=null) {
            sb.append(subGridModel.generateProperties());
        }
        if (subGridWidth!=20) sb.append("\nsubGridWidth: ").append(subGridWidth).append(',');
        if (subGridURL!=null) sb.append("\nsubGridUrl: ").append(subGridURL).append(',');
        if (subGridType!=null) sb.append("\nsubgridtype: ").append(subGridType).append(',');

        if (sb.length()>0) {
            sb.deleteCharAt(sb.length()-1);
        }

        return sb;
    }



}
